//
//  KKBLEConnect.h
//
//  Created by zorro on 2017/11/13.
//  Copyright © 2017年 zorro. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "KKBLEConfig.h"
#import "KKBLEDFUHelper.h"
#define KK_BLEConnect   [KKBLEConnect sharedInstance]
#define KK_BLEModel     [KKBLEConnect sharedInstance].model
#define KK_BLEConfig    [KKBLEConnect sharedInstance].config
#define KK_BLEDFUHElper [KKBLEDFUHelper sharedInstance]

@interface KKBLEConnect : NSObject

@property (nonatomic, strong) KKBLEModel  *model;         // 当前链接的设备
@property (nonatomic, strong) KKBLEConfig *config;        // 产品配置文件
@property (nonatomic, assign) BOOL       centerPowerOn;
@property (nonatomic, strong) NSMutableArray *devicesArray;

@property (nonatomic, strong) KKBLEUpdateBlock updateModelStatus;
@property (nonatomic, strong) KKBLEAcceptBlock bleConnectAcceptBlock;
@property (nonatomic, assign) BOOL isConnected;
@property (nonatomic, assign) BOOL isUpdateing;
@property (nonatomic, assign) BOOL isFoundPair;
@property (nonatomic, assign) BOOL isBoindDevice;

AS_SINGLETON(KKBLEConnect)

// 不取消当前设备的情况下扫描
- (void)scanWithoutBreakConnect;
- (void)stopScan;
- (void)connectPeripheralWithModel:(KKBLEModel *)model;
- (void)initiativeDismiss;
- (void)disConnect;
- (void)exPairDevice;
- (void)UpdateFirmWareInfoBackground;
- (void)startUpdateFirmWare;
- (void)firmWareUpdateEnd:(BOOL)success;

@end

